﻿using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using MediatR;
using WeatherHistory.Shared.Validation;

namespace WeatherHistory.Api.CommandsQueries.Commands.Weathers.Update;

public class UpdateWeathersCommandRequest : IRequest<UpdateWeathersCommandResponse>
{
    [JsonIgnore]
    public long OldRegionId { get; set; }

    [Required]
    public long RegionId { get; set; }

    [Required]
    public string RegionName { get; set; } = null!;

    [GreaterThanOrEqual(0f)]
    public float WindSpeed { get; set; }

    [WeatherCondition(false)]
    public string WeatherCondition { get; set; } = null!;

    [GreaterThanOrEqual(0f)]
    public float PrecipitationAmount { get; set; }

    [Required]
    public DateTime MeasurementDateTime { get; set; }

    public float Temperature { get; set; }
    public float Humidity { get; set; }
    public List<long>? WeatherForecast { get; set; }
}